<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      function fn() {
        console.log(arguments); //arguments 存储了所有的实参  是一个 伪数组
        // console.log(arguments[2]);
        for (var i = 0; i < arguments.length; i++) {
          console.log(arguments[i]);
        }
      }

      fn(1, 2, 3);
    </script>

    <!-- arguments案列  求任意数的最大值-->
    <script>
      function getmax() {
        var max = arguments[0];
        for (var i = 1; i < arguments.length; i++) {
          if (arguments[i] > max) {
            max = arguments[i];
          }
        }
        return max;
      }
      console.log(getmax(71, 50, 61, 92, 1));
    </script>
    <script>
      function zks() {
        const args = arguments;
        console.log(args);
        return function (...zz) {
          console.log(zz);
        };
      }
      zks(1, 2, 3, 4)(123,4,5,6);
    </script>
  </head>

  <body></body>
</html>
